<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>鼠标移上去和移开</title>
    <script type="text/javascript">
        var  bc;
        var  fc;
        var  cs;
        //鼠标移上去执行       修改鼠标的样式   修改背景颜色    修改字体的颜色
        function openme(elementTr){
            bc=elementTr.style.backgroundColor;
            fc = elementTr.style.color;
            cs=elementTr.style.cursor;
            //修改tr的样式
            elementTr.style.backgroundColor='#CCCCCC';
            elementTr.style.color = '#FFFFFF';
            elementTr.style.cursor='pointer';

        }

        //鼠标移开去执行       返回成原来的样式
        function closeme(elementTr){
            elementTr.style.backgroundColor=bc;
            elementTr.style.color =fc;
            elementTr.style.cursor=cs;
        }


    </script>

</head>
<body>
<form action=onmouseover2.html method=post name=f>
    <table border=1 align=center width=80% style="line-height:25px">
        <caption><h3>信息显示</h3></caption>
        <tr bgcolor=#C7D7E7>
            <th>&nbsp;</th>
            <th>编号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>电话</th>
            <th>QQ</th>
            <th>邮箱</th>
            <th>备注</th>
            <th colspan=2>数据操作</th>
        </tr>
        <script language="javascript">
            for(i=1;i<=10;i++)
            {
                if(i%2==0)
                    document.write("<tr align=center style='background-color:#EAEAEA' onmouseover='openme(this)' onmouseout='closeme(this)'>");
                else
                    document.write("<tr align=center style='background-color:#FFFFFF' onmouseover='openme(this)' onmouseout='closeme(this)'>");
                document.write("<td><input type=checkbox name=op value="+i+"></td>");
                document.write("<td>"+i+"</td>");
                document.write("<td>姓名"+i+"</td>");
                document.write("<td>男</td>");
                document.write("<td>20</td>");
                document.write("<td>1311911119"+i+"</td>");
                document.write("<td>123456"+i+"</td>");
                document.write("<td>asdgas@163.com</td>");
                document.write("<td>无</td>");
                document.write("<td><a href=#>修改</a></td>");
                document.write("<td><a href=# onclick='return del()'>删除</a></td>");
                document.write("</tr>");
            }
        </script>
        <tr>
            <td colspan=11>
                <input type=button name=enter value=全部选中 onclick="selectall()">
                <input type=button name=enter value=全部取消 onclick="resetall()">
                <input type=button name=enter value=反选 onclick="selectfan()">
                <input type=button name=enter value=全部删除 onclick="deleteall()">
            </td>
        </tr>
    </table><p align=center>
    第一页 上一页 下一页 最后一页 共 ? 页 当前是第 ? 页 跳转到第 <select></select> 页 <input type=submit name=enter value=跳转>
</form>
</body>
</html>